home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Diskmonitors / HexED / HexED.doc < prev    next >
Text File  |  1996-09-26  |  19KB  |  501 lines

  1. -----------------------------------------------------------------------------
  2.                              #   # ##### #   #
  3.                              #   # #      # #
  4.                              ##### ###     #
  5.                              #   # #      # #
  6.                              #   # ##### #   #
  7. -----------------------------------------------------------------------------
  8.  
  9.                       Hex V1.0, Copyright (c) 1990 by
  10.  
  11.                              Nicola Salmoria
  12.                              Via Piemonte 11
  13.                              53100 Siena  ITALY
  14.  
  15.                             All rights reserved.
  16.  
  17.  
  18. You can contact me on:
  19. MC-Link:      +39 6 4180440      my code is MC6489
  20.  
  21. Voice:        +39 577 54164
  22.  
  23. You can try to contact me on FidoNet, but it's unlikely you'll get an answer,
  24. 'cos there's yet no Fido node in Siena. Maybe in the future.
  25.  
  26.  
  27. This program is SHAREWARE. Copy it as much as you can (provided no charge is
  28. made and the archive is left intact). It can be included, with the same
  29. restrictions, in any commercial program without the written permission of the
  30. author.
  31. Contributions will be greatly appreciated and will help me support Hex in the
  32. future as well as develop new programs. Suggested contribution is $15.
  33. Hex development took 4 months. I spent much time in it, and I'd like to be
  34. rewarded for my work.
  35. Keep one thing in mind: I will probably add new features to Hex, but I will NOT
  36. release a new version until I get enough feedback. So you know what to do.
  37.  
  38.  
  39.  
  40. IMPORTANT NOTE: Hex has some unique features difficult to understand or to
  41. even know about without reading this doc file. If you're too lazy to read it
  42. all, you should read at least the 'Editing & keyboard' chapter, plus the
  43. explanations of the menu items you don't understand.
  44.  
  45. WARNING: This program in the wrong hands may be a lethal weapon! Use at your
  46. own risk. Anyway, Hex is provided "AS IS", without warranty of any kind, either
  47. expressed or implied. The author will never be liable for any loss of data,
  48. disk damage, computer explosion, earthquake, alien invasion, or anything else.
  49.  
  50. REMEMBER: It is both immoral and illegal to modify someone else's programs
  51. and redistribute them. All such changes should be considered strictly for
  52. personal use. If you want to let the rest of the world know about some nice
  53. changes you've devised, I think it may be considered acceptable to spread a text
  54. file explaining what to change (like I do with keymaps later on).
  55.  
  56.  
  57.  
  58. --------
  59. Overview
  60. --------
  61.  
  62. Hex is a file-based (as opposed to sector-based, like NewZAP) binary file
  63. editor. This means that the file is loaded in memory all at once, edited
  64. there and saved at the end. There are advantages and disadvantages in both
  65. approaches: sector-based editors heavy depend on device speed in operations
  66. like search; on the other hand, file based-ones take longer to display the
  67. file for the first time, 'cos they have to load it all. Moreover, file-based
  68. editors need more memory, and it may be impossible to load very large files.
  69. Hex uses the same text routines of MiniView80. This means it's got (one of)
  70. the fastest and smoothest screen rendering ever seen in a file editor.
  71.  
  72.  
  73.  
  74. ---------------
  75. Acknowledgement
  76. ---------------
  77.  
  78. I'd like to thank the following people for beta-testing and suggestions:
  79.  
  80. Federico Giannici
  81. Marco Ciuchini
  82. Antonio Rossi
  83. Massimiliano Marras
  84. Angelo Mariani
  85.  
  86.  
  87.  
  88. -------
  89. Loading
  90. -------
  91.  
  92. From WorkBench, double-click on Hex icon. You can use extended selection: click
  93. on Hex icon, then press SHIFT and double-click on the file icon.
  94.  
  95. From CLI, syntax is:
  96. Hex [filename] [NODETACH]
  97. If you specify a file name, it will be loaded on startup.
  98. By default, Hex detaches from the current CLI. You can disable this feature
  99. with the switch NODETACH. It may be useful if you execute Hex from one of that
  100. nice directory utilities.
  101.  
  102. IMPORTANT NOTE: To load Hex, the file 'req.library' must be in your LIBS:
  103. directory. Req.library is a freely distributable library by C.W.Fox and
  104. Bruce Dawson. If you are a programmer, you may want to take a look at it:
  105. it features the BEST file requester I have ever seen and many other nice
  106. functions.
  107.  
  108.  
  109.  
  110. -----------
  111. The gadgets
  112. -----------
  113.  
  114. Many hex functions are obtained thru the use of gadgets. Most of them can be
  115. operated also with menus. Of course selecting a menu is less handy than directly
  116. clicking in a gadget; menu operations are there mostly to provide keyboard
  117. shortcuts.
  118.  
  119. Search gadgets:
  120. ---------------
  121. In the 'Search' box there are many gadgets, all obviously related to the search
  122. functions. There are three boxes near to the words 'Search', 'Hex', 'Text'. Only
  123. one of them is selected, and indicates which search mode is currently active.
  124. You can click on them to quickly change search mode.
  125. If a match is found, cursor is placed at the start of it, and edit mode is
  126. changed to the corresponding one.
  127.  
  128. String
  129.          Search for a given string. Click in the string gadget below and enter
  130.          the text you want to search for. When you press return, search will
  131.          start at cursor position.
  132.  
  133. A=a
  134.          Search can be case sensitive or case unsensitive; you can switch the
  135.          flag with this gadget.
  136.  
  137. Hex
  138.          Search for a sequence of bytes you specify via their hexadecimal
  139.          notation. Click in the string gadget below and enter the byte sequence
  140.          you want to search. You can enter data as xx xx xx, xxxxxxxx, xxxx xx
  141.          xxxxxx, anyway you want, provided between two blank spaces there is an
  142.          even number of characters.
  143.  
  144. CAL
  145.          Imports in the hex gadget the value currently displayed on the
  146.          calculator display. A leading zero is added if needed.
  147.  
  148. Text
  149.          This is a special feature: it searches the file for occurrencies of at
  150.          least eight 'good' ASCII characters. It is useful to quickly locate
  151.          message strings in a file. When this box is selected, use 'Continue' to
  152.          scan the file.
  153.  
  154. Continue
  155.          Continues the search from the new cursor position.
  156.  
  157. << and >>
  158.          Specify the search direction.
  159.  
  160.  
  161. Other gadgets:
  162. --------------
  163. Start and End
  164.          These two behave differently if you are editing a file or GRABbing
  165.          memory (see below). In file mode, 'Start' is always zero and 'End'
  166.          indicates the last byte of the file (or, if you prefer, the file length
  167.          MINUS ONE). In memory mode, they indicate the start and end of the
  168.          memory grabbed. You can change the value contained in these gadgets:
  169.          the file will be modified accordingly, if possible. You can enlarge or
  170.          shrink a file, or change the 'window' on the memory. To add bytes at
  171.          the start of the file, simply insert a negative value. Note that when
  172.          you change the 'Start' gadget in file mode, it is reset to zero and the
  173.          'End' value is changed accordingly.
  174.          If you press SHIFT-Return in one of the gadgets, the other one is
  175.          activated. This is an easy way to change start and end together. It's
  176.          main use is to completely change the portion of memory grabbed.
  177.  
  178. Position
  179.          Reports the position occupied by the cursor in the file. Modify its
  180.          value to jump to a specific location.
  181.  
  182. Editing
  183.          Shows which side of the display you are editing: ASCII or HEX. This
  184.          gadget exists only in 'Hex/ASCII' display mode, in 'Only ASCII' it is
  185.          replaced by 'Value', which reports the hex value of the byte the cursor
  186.          is on. You can modify this value, so you don't have to change the
  187.          display mode to insert an hex value in the middle of an ASCII string.
  188.  
  189. UNDO and REDO
  190.          Self explainatory. Hex features a multi-level undo/redo (currently max
  191.          undo level is 256).
  192.  
  193.  
  194.  
  195. ---------
  196. The menus
  197. ---------
  198.  
  199. NOTE: I won't repeat it for every function, but every time you do something
  200. which would mean losing the current data, a requester will appear asking if you
  201. want to save the file, continue anyway, or cancel the operation.
  202.  
  203. Project:
  204. --------
  205. About
  206.          The usual information about the program.
  207.  
  208. New
  209.          Creates a new file. The current file is cleared, and the gadget 'End'
  210.          is activated. Type there the size MINUS ONE of the file you want to
  211.          create.
  212.  
  213. Open
  214.          Loads a new file. The req.library file requester will pop up, asking
  215.          you to select a file to load.
  216.  
  217. Save
  218.          Saves the file. Again the req.library requester will come, asking the
  219.          filename with which the file will be saved. If you want to overwrite
  220.          the previous version, simply click on OK.
  221.  
  222. GRAB Memory
  223.          WARNING: this function is dedicated to the expert users.
  224.          The current file is cleared, and the 'Start' gadget activated. Type
  225.          there the start address of the memory you want to grab. If you specify
  226.          a valid number, the 'End' gadget wil activate. Type the end address,
  227.          and there you go!
  228.          Hex will try to AllocAbs() the memory you specify: result of that
  229.          operation is displayed in the menu bar. If the buffer couldn't be
  230.          allocated, the 'Editable file?' flag (see below) is turned off, just to
  231.          provide more protection.
  232.          I deliberately don't check if the memory addresses you specify are
  233.          locations you are allowed to access. I do so to let you GRAB portions
  234.          of memory like system ROMs, expansion ROMs, memory removed from the
  235.          system lists, and so on. For example, (my version of) the A2620 board
  236.          allocates its ROMs at F80000-F87DEF.
  237.          Please note that not only you can crash your system WRITING somewhere
  238.          you shouldn't, but also simply READING some forbidden locations.
  239.          Just to give you an idea, on my system locations between C80000 and
  240.          DFFFFF must be avoided.
  241.  
  242. Print
  243.          Sends current file to PRT:. If replacement char is '·', it is replaced
  244.          with '.'; char set 'all chars' is not supported, replaced with 'only
  245.          printable'.
  246.  
  247. Print marked
  248.          Sends to PRT: the portion of the file between the two mark positions.
  249.          It doesn't matter which of the two comes before. Note that the two
  250.          marks are always set somewhere - if you don't initialize them, they
  251.          will point one to the start and the other to the end of the file.
  252.  
  253. Iconify
  254.          Iconifies Hex. Memory is freed, buffer purged and screen closed - and
  255.          a small window is opened in the WorkBench screen. To reactivate Hex,
  256.          press the right button when that window is active. You can quit
  257.          definitively with the close gadget.
  258.  
  259. Quit
  260.          Guess what?
  261.  
  262.  
  263. Environment:
  264. ------------
  265. Palette
  266.          Invokes req.library color requester.
  267.  
  268. Display
  269.          Two modes are available: Hex/ASCII which prints 16 bytes per row,
  270.          showed in hexadecimal long words and in plain ASCII. Only ASCII prints
  271.          48 bytes per row, only as ASCII characters.
  272.  
  273. Char set
  274.          Selects which characters should be filtered out in the ASCII dump.
  275.          'All chars' means no substitutions are made; 'Only printable' means
  276.          only chars $20-$7F and $A0-$FF are showed; 'Only $20-$7F' is self
  277.          explanatory.
  278.  
  279. Replacement char
  280.          Specifies the char with which filtered chars are substituted.
  281.          Choice is between ' ' (space) ,'.' (full stop) and '·' (?? code $B7)
  282.  
  283. Load settings
  284.          Loads current settings from 'hex.config'.
  285.  
  286. Save settings
  287.          Saves current settings to 'hex.config'. On future loadings of Hex,
  288.          the saved settings will be automatically re-loaded.
  289.          Settings saved are: Palette, Display, Char set, Replacement char,
  290.          Backspace=undo, Ignore case, Overwrite NULLs, search mode, Iconify
  291.          window position.
  292.  
  293. Default settings
  294.          Uses the built-in settings.
  295.  
  296.  
  297. Edit:
  298. -----
  299. Undo/Redo
  300.          Same as the corresponding gadgets.
  301.  
  302. Backspace = undo?
  303.          Selects if pressing the backspace key (top right of keyboard) should
  304.          be the same as selecting Undo (or pressing its keyboard shortcut).
  305.  
  306. Change file start
  307.          All this item does is activate the 'Start' gadget.
  308.  
  309. Start at cursor pos
  310.          Easy way to make a file begin at the cursor position (instead of
  311.          selecting 'Start', and writing there the correct value).
  312.  
  313. Change file end
  314.          Activates the 'End' gadget.
  315.  
  316. End at cursor pos
  317.          Faster way to specify file's end position.
  318.  
  319. Switch edit mode / Change value
  320.          Same as the corresponding gadgets.
  321.  
  322. Overwrite NULLs?
  323.          Specifies if in ASCII edit bytes which are zero can be modified.
  324.          When you replace text strings in an executable, e.g. the names of the
  325.          menus, it is VERY important the new strings don't exceed previous
  326.          lengths. Since C strings are NULL-terminated, when this item is
  327.          de-selected, you won't be able to write past the max length allowed.
  328.  
  329. Editable file?
  330.          If this is not checked, the file cannot be modified in any way. This
  331.          flag is turned OFF when you GRAB a portion of memory which can't be
  332.          allocated; it's turned ON every time the buffer is clear (Load, New)
  333.  
  334.  
  335. Search:
  336. -------
  337. Search string
  338.          Activates the 'search string' gadget.
  339.  
  340. Search hex
  341.          Activates the 'search hex' gadget.
  342.  
  343. Search text
  344.          Searches for text, as specified before. To continue search, you can use
  345.          'continue' as well as this item again.
  346.  
  347. Ignore case?
  348.          Switches the case dependancy flag. Equivalent to the 'A=a' gadget.
  349.  
  350. Direction
  351.          Selects the search direction. Equivalent to the corresponding gadgets.
  352.  
  353. Continue search
  354.          Repeats last search made. The same as the 'continue' gadget.
  355.  
  356.  
  357. Move:
  358. -----
  359. Top
  360.          Jumps to start of file.
  361.  
  362. Bottom
  363.          Jumps to end of file.
  364.  
  365. Any position
  366.          Activates the 'position' gadget.
  367.  
  368. Mark location n
  369.          Set the mark 'n' to the present cursor position. Marks are used also by
  370.          the 'print marked' function.
  371.  
  372. Jump to mark n
  373.          Jumps to mark 'n'. If the mark wasn't set, jump to start/end of file.
  374.  
  375.  
  376.  
  377.  
  378. The calculator
  379. --------------
  380.  
  381. NOTE: on 640x200 screens this feature is not available. NTSC users should usa an
  382. interlaced screen.
  383.  
  384. On the top right corner of the screen there is a simple calculator. It's use is
  385. fairly simple, being like any usual calculator. I want to point out that you can
  386. use both hte mouse in the intuitive way and the keyboard. In that case, here are
  387. the equivalents to the not-so-intuitive keys:
  388. .                = +/-
  389. $ or H           = Hex
  390. # or T           = Dec
  391. Del or BackSpace = Clear
  392. Help             = On/Off
  393.  
  394. Moreover, the grey keys on the keypad act as the keys A-F. The same keys SHIFTed
  395. or CAPS LOCKed represent the four operations and the Hex/Dec gadgets. Note that
  396. if you press SHIFT while CAPS LOCK is lit, you get A-F again.
  397.  
  398.  
  399. One nice thing to note is that the calculator is a stand-alone task, separated
  400. from the main program; this means it is ALWAYS available, even when Hex is doing
  401. something else like displaying a requester or loading a file from disk.
  402. Another important thing is that the calculator runs on its own window; so don't
  403. panic if when you use it you lose the menus - just click in the main window and
  404. you'll get them back.
  405.  
  406.  
  407.  
  408. Moving around
  409. -------------
  410.  
  411. There are many ways to move through the file. Clicking on any valid position
  412. will put the cursor there; if you keep the left button pressed and move the
  413. pointer, the cursor will follow you. If you move the pointer to the extreme
  414. top or bottom of screen, you'll scroll through the file. Edit mode changes
  415. correspondingly to where you click.
  416.  
  417. To fast reach a known position you can use the Jump command or the scroll
  418. bar on the right of the screen.
  419.  
  420. Using keyboard, cursor keys in combination with shift, alt, ctrl have many
  421. effects. Plain cursor keys move the cursor, and scroll file, in the intuitive
  422. way; shift-up and shift-down move 8 positions at a time and scroll faster;
  423. alt-up and alt-down move one page at a time; any qualifier together with
  424. left/right moves to begin/end of current line. Ctrl-up and ctrl-down move to
  425. start and end of file.
  426.  
  427.  
  428.  
  429.  
  430. Editing & keyboard
  431. ------------------
  432.  
  433. In ASCII edit, simply type what you like. Note that Return generates a LF ($0A),
  434. while Enter a CR ($0D). Moreover, SHIFT-Return generates a NULL. This is very
  435. useful to terminate strings without having to switch to HEX edit.
  436. In HEX edit, type couples of hex chars. If you mistake the first number,
  437. SPACE will cancel it. Please note that you won't see the first number you
  438. type: only the full byte is substituded after you enter the couple of chars.
  439.  
  440. Hex uses RawKeyConvert(), so custom keymaps ARE supported.
  441. There is an exception: while in hex edit, grey keys on the numeric keypad
  442. behave like keys A-F. This allows very fast input of data. This is the layout
  443. of the keypad:
  444.  
  445.        +-----+-----+-----+-----+
  446.        |     |     |     |     |
  447.        |  A  |  B  |  C  |  D  |
  448.        |     |     |     |     |
  449.        +-----+-----+-----+-----+
  450.        |     |     |     |     |
  451.        |  7  |  8  |  9  |  E  |
  452.        |     |     |     |     |
  453.        +-----+-----+-----+-----+
  454.        |     |     |     |     |
  455.        |  4  |  5  |  6  |  F  |
  456.        |     |     |     |     |
  457.        +-----+-----+-----+-----+
  458.        |     |     |     |     |
  459.        |  1  |  2  |  3  |  E  |
  460.        |     |     |     |  n  |
  461.        +-----+-----+-----+  t  |
  462.        |           |     |  e  |
  463.        |     0     |  .  |  r  |
  464.        |           |     |     |
  465.        +-----------+-----+-----+
  466.  
  467. Such feature would be handy also in the input gadgets; however, they are handled
  468. by Intuition, so a keymap is needed. I have provided a file called 'h', which is
  469. a custom keymap you should put in DEVS:keymaps.
  470. However, if you like, you can modify your keymap and use it with hex or anywhere
  471. you like. Here is how to proceed:
  472.  
  473. - Load Hex (this is the least you could expect!).
  474. - OPEN DEVS:keymaps/your_keymap.
  475. - JUMP to 20F. There should be a '-' there.
  476. - Modify the '-' to 'E'.
  477. - JUMP to 24F. This is the top-left key in the keypad.
  478. - Modify it to 'A'.
  479. - Go to 253. Modify to 'B'.
  480. - Go to 257. Modify to 'C'.
  481. - Go to 25B. Modify to 'D'.
  482. - Go to 25F. Modify to 'F'.
  483. - SEARCH for '?~'. After these two chars, there should be the name of the
  484.   keyboard. Replace it with 'h'. If the keymap name is longer then one char,
  485.   remember to put a NULL after h.
  486. - SAVE as DEVS:keymaps/h
  487.  
  488. All done. Hex will automatically load DEVS:keymaps/h on startup.
  489.  
  490.  
  491.  
  492.  
  493. Note about requesters
  494. ---------------------
  495.  
  496. You don't need mouse to reply to req.library requesters. There's a whole
  497. range of keys you can use, the easiest to remember are:
  498. L for the left gadget
  499. M for the middle gadget
  500. R for the right gadget
  501.